# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-python-evt
pkgname=('python2-python-evt' 'python-python-evt')
_pkgname=python-evt
pkgver=0.1
pkgrel=11
pkgdesc='Pure Python parser for classic Windows event log files (.evt).'
arch=('any')
url='https://pypi.org/project/python-evt/#files'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('92adbf58c07c7c83b9850013955654c998b0633cc5d565cf7e55d65803dcf335066f8e017a1d77eb6c47798d6faea83e08f1deefc72cefd2846aa2a1dc57eadd')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-python-evt() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-python-evt() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

